package com.noble.meether.chat.ui.system.bean;

import com.noble.library.base.bean.BaseData;
import com.noble.library.utils.StringUtils;

import org.json.JSONObject;

/**
 * 系统公告
 */
public class SysNotice extends BaseData {
    private int id;

    private String title;
    private String image;
    private String text;
    private String url;
    private String timeCreate;

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        this.id = jsonObject.optInt("Id");
        this.title = jsonObject.optString("Title");
        this.image = jsonObject.optString("Image");
        this.text = jsonObject.optString("Text");
        this.url = jsonObject.optString("Url");
        this.timeCreate = jsonObject.optString("TimeCreate");
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public void setText(String text) {
        this.text = text;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setTimeCreate(String timeCreate) {
        this.timeCreate = timeCreate;
    }

    public int getId() {
        return id;
    }

    public String getTimeCreate() {
        return StringUtils.getCreateTime(timeCreate);
    }

    public String getTitle() {
        return title;
    }

    public String getImage() {
        return image;
    }

    public String getText() {
        return text;
    }

    public String getUrl() {
        return url;
    }
}
